package com.ruoyi.capsule.controller;

import com.ruoyi.capsule.service.LoginWxService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class LoginWxController {
    @Autowired
    private LoginWxService loginWxService;

    @PostMapping("/wxlogin")
    public AjaxResult wxlogin(@RequestBody Map<String, Object> requestData) {

        String code = (String) requestData.get("code");
        return loginWxService.wxlogin(code);
    }

}
